import difflib


def similarity(str1, str2):
    return difflib.SequenceMatcher(None, str1, str2).ratio()

def job_rec_cls(user_major, all_majors):
    job_list = []
    for num, major_list in all_majors:
        if user_major in major_list:
            job_list.append([1, num])
        else:
            seq = 0
            for major in major_list:
                sim = similarity(user_major, major)
                if sim > seq:
                    seq = sim
            if seq > 0.8:
                job_list.append([seq, num])
    job_list.sort(reverse=True)
    return job_list